home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / comm / mail / GDMail_1_3.lha / gdmail / Install < prev    next >
Encoding:
Text File  |  1995-04-02  |  9.0 KB  |  333 lines

  1. ;
  2. ; Installation script for the bgui.library (OS 2.0)
  3. ;
  4.  
  5. ; Strings
  6.  
  7. (set @default-dest "")
  8. (set lib-source   "libs/bgui.library")
  9. (set lib-def-dest "LIBS:")
  10. (set lib-to       "Where do you want bgui.library copied to?")
  11. (set lib-help
  12.     (cat      "If you have a special directory setup for third-party\n"
  13.           "libraries you can select it here.\n\n\n"
  14.     )
  15. )
  16. (set gad-source   "gadgets/textfield.gadget")
  17. (set gad-def-dest "SYS:Classes/Gadgets")
  18. (set gad-to       "Where do you want textfield.gadget copied to?")
  19. (set gad-help
  20.     (cat      "If you have a special directory setup for third-party\n"
  21.           "gadgets you can select it here.  If you are running\n"
  22.           "Kickstart 2.04 set this to LIBS:\n\n\n"
  23.     )
  24. )
  25. (set files-def-dest "Work:GDMail")
  26. (set files-to       "Where do you want the GDMail files copied to?")
  27. (set files-help
  28.     (cat      "The GDMail distribution files will be copied to the\n"
  29.           "selected directory.\n\n\n"
  30.     )
  31. )
  32. (set heir-def-dest "Work:UUCP")
  33. (set heir-to       "Where do you want the UUCP hierarchy to be created?")
  34. (set heir-help
  35.     (cat      "A UUCP directory and sub-directories will be created in the "
  36.           "selected directory.\n\n\n"
  37.     )
  38. )
  39. (set wrong-kick   "You must be running Kickstart 2.04 to use the bgui.library.")
  40. (set copy-msg     "Copying the bgui.library to ")
  41. (set hail-msg
  42.     (cat      "\n\n\nGDMail Installation Script.\n"
  43.           "This script will install the GDMail distribution including "
  44.           "bgui.library and textfield.gadget on your Amiga.\n\n"
  45.           "GDMail is © 1994-1995 Stan Burton\n"
  46.           "bgui.library is © 1993-1994 Jaba Development\n"
  47.           "textfield.gadget is © 1994 Mark Thomas\n"
  48.           "All Rights Reserved."
  49.     )
  50. )
  51.  
  52. ; Correct OS version?
  53.  
  54. (if (< (/ (getversion) 65536) 37) (abort wrong-kick))
  55.  
  56. (message hail-msg)
  57.  
  58. (if (> 1 (exists "UUCP:" (noreq)))
  59.     (
  60.  
  61. ; Ask create UUCP:
  62.         (set answer
  63.             (askbool
  64.                 (prompt "You do not currently have a UUCP: assignment\n\n"
  65.                     "While UUCP is not required for GDMail, some of its "
  66.                     "assignments are used by GDMail.\n\n\n"
  67.                     "Do you wish to create the required heirarchy and assignments "
  68.                     "and place the assignments in your startup?")
  69.                 (help "GDMail requires that the logical assignments UUMAIL: and UULIB: "
  70.                       "be available.  If you like, the installer will create a small "
  71.                       "heirarchy of mostly empty directories and the required assignments. "
  72.                       "Note that GDMail requires a sendmail program to distribute any "
  73.                       "mail you send.  Sendmail may require other directories and assignments in "
  74.                       "this heirarchy.")
  75.             )
  76.         )
  77.         (if answer
  78.             (
  79.  
  80. ; Ask where to create the heirarchy.
  81.  
  82.                 (set lib-dest
  83.                     (askdir
  84.                         (prompt  heir-to)
  85.                         (help    heir-help)
  86.                         (default heir-def-dest)
  87.                     )
  88.                 )
  89.  
  90. ; Create the heirarchy
  91.                 (makedir (tackon lib-dest "UUCP")
  92.                     (prompt)
  93.                 )
  94.                 (makedir (tackon lib-dest "UUCP/UUMail")
  95.                     (prompt)
  96.                 )
  97.                 (makedir (tackon lib-dest "UUCP/UULib")
  98.                     (prompt)
  99.                 )
  100.                 (makeassign "UUCP" (tackon lib-dest "UUCP")
  101.                 )
  102.                 (makeassign "UUMail" (tackon lib-dest "UUCP/UUMail")
  103.                 )
  104.                 (makeassign "UULib" (tackon lib-dest "UUCP/UULib")
  105.                 )
  106.                 (copyfiles
  107.                     (source "Config")
  108.                     (dest "UULib:")
  109.                 )
  110.                 (startup "UUCP"
  111.                     (prompt "prompt")
  112.                     (help "help")
  113.                     (command (cat "Assign UUCP: " (tackon lib-dest "UUCP\n")))
  114.                     (command "Assign UUMail: UUCP:UUMail\n")
  115.                     (command "Assign UULib: UUCP:UULib\n")
  116.                 )
  117.             )
  118.         )
  119.     )
  120. )
  121.  
  122. ; Ask where to copy the library.
  123.  
  124. (set lib-dest
  125.     (askdir
  126.         (prompt  lib-to)
  127.         (help    lib-help)
  128.         (default lib-def-dest)
  129.     )
  130. )
  131.  
  132. ; Copy the library.
  133.  
  134. (copylib
  135.     (prompt (cat copy-msg (tackon lib-dest "bgui.library") "..."))
  136.     (help   @copylib-help)
  137.     (source lib-source)
  138.     (dest   lib-dest)
  139.     (confirm)
  140. )
  141.  
  142. ; Ask where to copy the gadget.
  143.  
  144. (set gad-dest
  145.     (askdir
  146.         (prompt  gad-to)
  147.         (help    gad-help)
  148.         (default gad-def-dest)
  149.     )
  150. )
  151.  
  152. ; Copy the gadget.
  153.  
  154. (copylib
  155.     (prompt (cat copy-msg (tackon gad-dest "textfield.gadget") "..."))
  156.     (help   @copygad-help)
  157.     (source gad-source)
  158.     (dest   gad-dest)
  159.     (confirm)
  160. )
  161.  
  162. ; Ask install the files.
  163. (set files-dest (expandpath ""))
  164. (set answer
  165.     (askbool
  166.         (prompt "If you did not dearchive or copy the GDMail "
  167.             "distribution files into the desired directory "
  168.             "the installation will now copy them into the directory you choose.\n\n\n"
  169.             "Do you wish to install the GDMail files?")
  170.         (help "Many people dearchive archived files into a directory "
  171.               "or volume other than the one that they want to "
  172.               "install into.  Often this is the Ram: volume.  If "
  173.               "this is what you did then choose Yes and you "
  174.               "will be prompted for the directory to copy the required files to.")
  175.     )
  176. )
  177. (if answer
  178.     (
  179.  
  180. ; Ask where to copy the files.
  181.         (set files-dest
  182.             (askdir
  183.                 (prompt  files-to)
  184.                 (help    files-help)
  185.                 (default files-def-dest)
  186.             )
  187.         )
  188.  
  189. ; Copy the files.
  190.         (copyfiles
  191.             (source "")
  192.             (dest files-dest)
  193.             (choices "GDMail" "README" "TextField.doc" "mailtogd" "GDMail.doc" "MailTool.cd" ".dmailrc")
  194.             (infos)
  195.         )
  196.         (set bookname (cat (getenv "user") ".book"))
  197.         (if (> 1 (exists bookname (noreq)))
  198.             (
  199.                 (copyfiles
  200.                     (source "example.book")
  201.                     (dest files-dest)
  202.                     (newname bookname)
  203.                 )
  204.             )
  205.         )
  206.     )
  207. )
  208.  
  209. ; Ask create GDMail path
  210. (set answer
  211.     (askbool
  212.         (prompt "Some of the features of GDMail require that GDMail "
  213.             "be in your path.\n\n\n"
  214.             "Do you wish to have a GDMail path command added to your startup?")
  215.         (help "GDMail requires the path for access to the mailtoGD program for "
  216.               "sending MIME mail.  The path may also be required for other programs "
  217.               "now or in the future.  NOTE: It is not sufficient to use an alias "
  218.               "in your shell startup.")
  219.     )
  220. )
  221. (if answer
  222.     (
  223.  
  224. ; Create the path
  225.         (startup "GDMail"
  226.             (prompt "prompt")
  227.             (help "help")
  228.             (command (cat "Path " files-dest " add\n"))
  229.         )
  230.     )
  231. )
  232.  
  233. (if (> 1 (exists "UULIB:.dmailrc" (noreq)))
  234.     (
  235.  
  236. ; Ask install the default .dmailrc file.
  237.         (set answer
  238.             (askbool
  239.                 (prompt "You do not currently have a .dmailrc file\n\n\n"
  240.                     "Do you wish to create a .dmailrc file?")
  241.                 (help "The .dmailrc file configures the way GDMail works for "
  242.                       "you.  If you have not previously installed DMail "
  243.                       "or GDMail the installer will let you create a "
  244.                       ".dmailrc file.")
  245.             )
  246.         )
  247.         (if answer
  248.             (
  249.  
  250. ; Get .dmailrc options
  251.                 (set answer
  252.                     (askoptions
  253.                         (choices "mime_automatic"
  254.                              "reverse_display"
  255.                              "text_plain_is_mime"
  256.                              "use_book"
  257.                              "use_custom_screen"
  258.                              "view_by_name"
  259.                         )
  260.                         (default $20)
  261.                         (prompt "Choose Configuration Options")
  262.                         (help
  263.                             (cat "mime_automatic - MIME formatted messages will be handled "
  264.                                 "automatically if this variable is set, otherwise "
  265.                                 "GDMail will ask you what to do when a MIME message arrives.\n\n"
  266.                                 "reverse_display - By default, GDMail displays mail "
  267.                                 "messages newest first.  If you would like the messages to "
  268.                                 "be displayed oldest first, set this variable.\n\n"
  269.                                 "text_plain_is_mime - MIME formatted messages of the "
  270.                                 "type text/plain can be read easily within GDMail.  If "
  271.                                 "you would rather do this than using the MIME reader, then "
  272.                                 "do not set this variable, otherwise ALL types of MIME messages "
  273.                                 "are passed to the MIME handling program.\n\n"
  274.                                 "use_book - GDMail contains a directory for user names "
  275.                                 "and addresses that can be used as destinations for your "
  276.                                 "mail messages.  If you always want to choose names from this "
  277.                                 "directory set this variable.\n\n"
  278.                                 "use_custom_screen - GDMail will try to open its window on the system "
  279.                                 "public screen, usually WorkBench or on the public screen "
  280.                                 "specified in the variable pub_screen_name, unless this "
  281.                                 "variable is set.  If set, GDMail will open on a "
  282.                                 "custom public screen.\n\n"
  283.                                 "view_by_name - By default GDMail displays the users "
  284.                                 "address in the message list.  If you would rather have "
  285.                                 "the users name (if available) displayed, set this variable."
  286.                             )
  287.                         )
  288.                     )
  289.                 )
  290.                 (if (<> (BITAND answer $01) 0)
  291.                     (set T1 "set mime_automatic TRUE\n")
  292.                     (set T1 "set mime_automatic (TRUE)\n")
  293.                 )
  294.                 (if (<> (BITAND answer $02) 0)
  295.                     (set T2 "set reverse_display TRUE\n")
  296.                     (set T2 "set reverse_display (TRUE)\n")
  297.                 )
  298.                 (if (<> (BITAND answer $04) 0)
  299.                     (set T3 "set text_plain_is_mime TRUE\n")
  300.                     (set T3 "set text_plain_is_mime (TRUE)\n")
  301.                 )
  302.                 (if (<> (BITAND answer $08) 0)
  303.                     (set T4 "set use_book TRUE\n")
  304.                     (set T4 "set use_book (TRUE)\n")
  305.                 )
  306.                 (if (<> (BITAND answer $10) 0)
  307.                     (set T5 "set use_custom_screen TRUE\n")
  308.                     (set T5 "set use_custom_screen (TRUE)\n")
  309.                 )
  310.                 (if (<> (BITAND answer $20) 0)
  311.                     (set T6 "set view_by_name TRUE\n")
  312.                     (set T6 "set view_by_name (TRUE)\n")
  313.                 )
  314.  
  315. ; Write .dmailrc
  316.                 (textfile
  317.                     (dest "UULIB:.dmailrc")
  318.                     (append "set headfile  uulib:$user$.header\n")
  319.                     (append "set sigfile  uulib:$user$.signature\n")
  320.                     (append "set replyfields  \"Reply-To: Return-Path:\"\n")
  321.                     (append "set _headchar >\n")
  322.                     (append T1)
  323.                     (append T2)
  324.                     (append T3)
  325.                     (append T4)
  326.                     (append T5)
  327.                     (append T6)
  328.                 )
  329.             )
  330.         )
  331.     )
  332. )
  333.